package fenyu.personblob.bean.factory.abstractf;

import fenyu.personblob.bean.Bean;
import fenyu.personblob.bean.databean.user.AdminUser;
import fenyu.personblob.bean.databean.user.CustomUser;
import fenyu.personblob.bean.databean.user.DefaultUser;
import fenyu.personblob.error.NoSuchTypeError;
import fenyu.personblob.error.UnknownError;

/**
 * create at 2018/12/21 21:51
 *
 * @author 纷羽 <gzj0078@gmail.com>
 */
public class UserFactory extends AbstractFactory {

    @Override
    public Bean createUser(String type) {
        if(type.equals("custom"))
        return new CustomUser();
        else if(type.equals("default"))
            return new DefaultUser();
        else if(type.equals("admin"))
            return new AdminUser();
        else throw new NoSuchTypeError();
    }

    @Override
    public Bean createBlob(String type) {
        throw new UnknownError();
    }

    @Override
    public Bean createBlobComment(String type) {
        throw new UnknownError();
    }
    
}
